#ifndef ZL_REGEX_REGEXWRITE
#define ZL_REGEX_REGEXWRITE
#include "RegexExpression.h"

namespace zl
{
	namespace regex
	{
		class RegexNode:public Object
		{
		public:
			zl::regex_internal::Expression::Ref  expression;

			RegexNode(zl::regex_internal::Expression::Ref _expression);
			RegexNode            Some()const;
			RegexNode            Any()const;
			RegexNode            Opt()const;
			RegexNode            Loop(zint min,zint max)const;
			RegexNode            AtLeast(zint min)const;
			RegexNode            operator +(const RegexNode& node)const;
			RegexNode            operator |(const RegexNode& node)const;
			RegexNode            operator %(const RegexNode& node)const;
			RegexNode            operator +()const;
			RegexNode            operator -()const;
			RegexNode            operator !()const;
		};

		extern  RegexNode        rCapture(const std::wstring& name, const RegexNode& node);
		extern  RegexNode        rUsing(const std::wstring& name);
		extern  RegexNode        rMatch(const std::wstring& name, zint index = -1);
		extern  RegexNode        rMatch(zint index);
		extern  RegexNode        rBegin();
		extern  RegexNode        rEnd();
		extern  RegexNode        rC(wchar_t a,wchar_t b=L'\0');
		extern  RegexNode        r_d();
		extern  RegexNode        r_l();
		extern  RegexNode        r_w();
		extern  RegexNode        rAnyChar();
	};
};
#endif
